package servlet;

public class ChangeIdToInfo {
private String Number="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
public String toBeShort(int x){
	String result="";
	
	char[] temp=Number.toCharArray();
	int l=temp.length;
	while(x/l>=1){
		result=temp[(int)(x%l)]+result;
		x/=l;
	}
	result=temp[(int)(x%l)]+result;
	return result;
}
public int toBeLong(String s){
	int result=0;
	char[] temp=Number.toCharArray();
	if(s!=null||!"".equals(s)){
		s=s.trim();
		char[] x=s.toCharArray();
		int l=s.length();
		int m=temp.length;
		for(int i=0;i<l;i++){
			result+=Number.indexOf(x[l-1-i])*(int)Math.pow(m, i);
		}
	}
	return result;	
}



}
